<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/7/16
 * Time: 9:58
 */

namespace app\common\validate;


use think\Validate;

class Member extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'	=>	['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'username'      => 'require|min:5|max:20',
        'password'      => 'require|min:6|max:20',
        'captcha'       => 'require|captcha',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名'	=>	'错误信息'
     *
     * @var array
     */
    protected $message = [
        'username.require'      => '用户名必须',
        'username.max'          => '用户名最多不能超过20个字符',
        'username.min'          => '用户名最少不能低于5个字符',
        'password.require'      => '密码必须',
        'captcha.require'       => '验证码不能为空',
        'captcha.captcha'       => '验证码错误',
    ];
}